import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/display.css'
import './styles/element-variables.scss'
import '@/styles/index.scss' // global css

import App from './App'
import router from './router'
import store from './store'
import components from '@/components' // 注册全局组件
import * as utils from './utils' // global functions

import '@/icons' // icon
import '@/permission' // permission control
import 'vue-tree-halower/dist/halower-tree.min.css' // 你可以自定义树的样式
import VTree from 'vue-tree-halower'

import axios from 'axios'
import vcolorpicker from 'vcolorpicker'

Vue.use(vcolorpicker)
Vue.prototype.$axios = axios

Vue.use(VTree)
Vue.use(ElementUI)
Vue.use(components)

import * as filter from './filter'

import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
Vue.use(Viewer, {
  defaultOptions: {
    zIndex: 9999,
    scalable: false
  }
})

Object.keys(filter).forEach(key => {
  Vue.filter(key, filter[key])
})
// register global functions
Object.keys(utils).forEach(key => {
  Vue.prototype['$' + key] = utils[key]
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
